package com.lee.lease.web.app.controller.apartment;

import com.lee.lease.common.result.Result;
import com.lee.lease.web.app.service.ApartmentInfoService;
import com.lee.lease.web.app.vo.apartment.ApartmentDetailVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: ApartmentController
 * Package: com.lee.lease.web.app.controller.apartment
 * Description:
 */
@Tag(name = "公寓信息")
@RestController
@RequestMapping("/app/apartment")
public class ApartmentController {
    @Autowired
    private ApartmentInfoService service;

    @Operation(summary = "根据id获取公寓信息")
    @GetMapping("/getDetailById")
    public Result<ApartmentDetailVo> getDetailById(Integer id){

//        ApartmentDetailVo apartmentDetailVo = service.findApartmentDetailById(id);  //307ms


        ApartmentDetailVo apartmentDetailVo = service.findApartmentDetailById1(id);  //284ms


//        ApartmentDetailVo apartmentDetailVo = service.findApartmentDetailById2(id);   //292ms
        return Result.ok(apartmentDetailVo);
    }
}
